package Interafce.InterfaceTest1;

public abstract class Animal {
    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Animal() {
    }
    public abstract void eat();//没有方法体的方法是抽象方法，用abstruct来修饰
    //抽象方法所在的类必须是抽象类，因此，此类用abstruct来修饰
    //public void eat(){}
}
